//
//  SYADTableViewCell.m
//  装修管家
//
//  Created by 千锋 on 16/1/20.
//  Copyright (c) 2016年 IOS1503薛凯. All rights reserved.
//

#import "SYADTableViewCell.h"
#import "Header.h"
#import "UIImageView+WebCache.h"
@implementation SYADTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _scrollview=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, DEVICEWIDTH, DEVICEHEIGHT/4)];
        _scrollview.pagingEnabled=YES;
        _scrollview.showsHorizontalScrollIndicator=NO;
        [self.contentView addSubview:_scrollview];
    }
    return self;
}
- (void)relayoutWithArrary:(NSArray*)arr{
    self.scrollview.contentSize=CGSizeMake(DEVICEWIDTH*(arr.count), DEVICEHEIGHT/4);
    for (int i=0; i<arr.count; i++) {
        UIImageView * image=[[UIImageView alloc] initWithFrame:CGRectMake(i*DEVICEWIDTH, 0, DEVICEWIDTH, DEVICEHEIGHT/4)];
        [image sd_setImageWithURL:[NSURL URLWithString:arr[i]]];
        [self.scrollview addSubview:image];
    }
}
@end
